//
//  TTNetworkResult.h
//  TTBaseProject
//
//  Created by shny588 on 16/7/19.
//  Copyright © 2016年 tt. All rights reserved.
//

#import <Foundation/Foundation.h>

//状态码
typedef NS_ENUM(NSUInteger, NetworkResultStatusCode) {
    NetworkResultStatusCodeSuccess = 100,         //网络数据
    NetworkResultStatusCodeNoData = 101,          //无数据,可能是错误提示
    NetworkResultStatusCodeDBError = 102,         //数据库错误
    NetworkResultStatusCodeParseError = 998,      //解析错误
    NetworkResultStatusCodeUnknowError = 999,     //未知错误
};
typedef NS_ENUM(NSUInteger, NetworkResultType) {
    NetworkResultTypeNetwork = 0,                   //网络数据
    NetworkResultTypeCache                          //缓存数据
};


@interface TTNetworkResult : NSObject

/**
 *  结果类型
 */
@property(assign,nonatomic) NetworkResultType resultType;
/**
 *  返回状态码
 */
@property(assign,nonatomic) NetworkResultStatusCode statusCode;
/**
 *  错误内容
 */
@property(strong,nonatomic) NSString *errMessage;
/**
 *  返回值
 */
@property(strong,nonatomic) id result;
/**
 *  扩展字段
 */
@property(strong,nonatomic) NSString *extra;

@end
